@extends('common.layouts')
@section('content')
    @include('common.message')
<div class="panel panel-default">
    <div class="panel-heading">学生列表</div>
    <table class="table table-striped table-hover table-responsive">
        <thead>
        <tr>
            <th>id</th>
            <th>姓名</th>
            <th>性别</th>
            <th>年龄</th>
            <th>邮箱</th>
            <th width="190">操作</th>
        </tr>
        </thead>
        <tbody>
        @foreach($students as $student)
        <tr>
            <th scope="row">{{$student->id}}</th>
            <td>{{$student->name}}</td>
            <td>{{$student->sex("$student->sex")}}</td>
            <td>{{$student->age}}</td>
            <td>{{$student->email}}</td>
            <td>
                <a href="{{route('student.show',$student)}}" class="btn btn-default">详情</a>
                <a href="{{route('student.edit',$student)}}" class="btn btn-default">修改</a>
                <a href="{{route('student.delete',$student)}}" class="btn btn-default"
                                onclick="if (confirm('确定删除吗?') == false) return false;">删除</a>
            </td>
        </tr>
        @endforeach
        </tbody>
    </table>
</div>

<!-- 分页  -->
<div>
    <div class="pull-right">
        {{$students->render()}}
    </div>
</div>
@endsection